/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package client.model;

import common.model.Visitor;
import javax.swing.DefaultListModel;

/**
 *
 * @author nicolas
 */
public class DefaultVisitorListModel extends DefaultListModel{

    public DefaultVisitorListModel() {
        super();
    }



    public void update(Visitor visitor){
        for(int i=0;i<super.size();i++){
            Visitor v = (Visitor)super.get(i);
            if(v.equals(visitor)){
                v.setX(visitor.getX());
                v.setZ(visitor.getZ());
                v.setRotation(visitor.getRotation());
                fireContentsChanged(this, 0, super.size());
                break;
            }
        }
    }
}
